package com.todo.demo.Dao;

import com.todo.demo.Model.*;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface PlanAndTaskDao {
    List<PlanWithTask> findAllPlanWithTask(int pageNum, int pageSize);

    List<PlanWithTask> findPlanWithTaskByUserId(int pageNum, int pageSize, @Param("userId") long userId);

    Plan finPlanByPlanId(long planId);

    PlanWithTask finTaskByTaskId(long taskId);

    long addPlan(Plan plan);
    long addTask(Task task);

    int setTaskCheckById(Task task);

    int deleteTaskById(PlanWithTask planWithTask);

    int deletePlanByPlanId(PlanWithTask planWithTask);

    int deleteTaskByPlanId(PlanWithTask planWithTask);
    int addUserToPlan(UserWithPlan userWithPlan);
    int updateTypeIdForPLan(Plan plan);

    List<Plan> findAllPlan(UserIdAndPlanId userIdAndPlanId);

    List<Task> finTaskByPlanId(UserIdAndPlanId userIdAndPlanId);
    List<Partner> getPartnerByPlanId(Partner partner);
    Partner isPartakeRepeat(Partner partner);
    int quitPartake(Partner partner);

    long getTaskAiNum();

    long getPlanAiNum();
    int updatePlanLastEditTime(Plan plan);
}